<template>
	<view class="demo-warter">
		<u-lazy-load threshold="750" border-radius="12" :error-img="errorImg" img-mode="aspectFill"
			:image="item.faceUrl+ '?x-oss-process=image/resize,h_600,m_lfit'"
			@click="clickImage(item.id)"></u-lazy-load>
		<view class="item-title">{{ item.villageName }}
			{{ item.type == 0 ? item.houseNum + item.houseHall + item.toiletNum :
				item.roomType_dictText }}
		</view>
		<view class="item-price">¥{{ item.price }}</view>
		<view class="item-desc">{{ item.type_dictText }} |
			{{ item.type == 2 ?  item.roomArea:item.houseArea }}㎡
			| {{ item.decoration }}
		</view>
	</view>
</template>

<script>
	export default {
		name: "WaterfallItem",
		props: {
			item: {
				type: Object,
				default: {
					id: undefined,
					decoration: undefined,
					roomArea: undefined,
					type: undefined,
					price: undefined,
					houseNum: undefined,
					houseHall: undefined,
					villageName: undefined,
				}
			}
		},
		data() {
			return {
				errorImg: 'https://house-guoli.oss-cn-hangzhou.aliyuncs.com/images/cover_default.jpg?x-oss-process=image/resize,h_600,m_lfit',
			};
		},
		methods: {
			clickImage(houseId) {
				this.$u.route({
					url: '/pages/detail/detail',
					params: {
						houseId: houseId
					}
				})
			},
		}
	}
</script>

<style lang="scss">

</style>